<?php

namespace app\admin\model;

use think\Model;

class Log extends Model
{
    use TraitModel;

    public function getUidAttr($value)
    {
        $res = model('admin/user')->where('id', $value)->field('id,name,image')->find();

        return $res;
    }

    public function getCidAttr($value)
    {
        $res = model('admin/card')->where('id', $value)->field('id,name')->find();

        return $res;
    }

    public function getCreateTimeAttr($value)
    {
        $res = [
            'day' => date('Y-m-d', $value),
            'time' => date('H:i', $value),
        ];

        return $res;
    }
}
